﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class PainelUsuario : System.Web.UI.MasterPage
{
    #region Properties

    public int ActiveMenu
    {
        get;
        set;
    }

    #endregion

    protected override void OnInit(EventArgs e)
    {
        if (PL.General.Instance.IsSessionValid(this.Session) == false)
        {
            this.Response.Redirect("login.aspx");
        }
        else
        {
            base.OnInit(e);
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (PL.General.Instance.IsSessionValid(this.Session) == false)
        {
            this.Response.Redirect("login.aspx");
        }
        else
        {
            base.OnInit(e);
        }
    }

    public string MenuActive(int menu)
    {
        return menu == this.ActiveMenu ? "active" : "";
    }   
}
